Repository navigation
PlayStation and Switch controllers as Xbox controllers for isolated games - #38
Merged
Merged
Conversation
…ames New pad bridge (Controllers page switch, off by default): the helper opens DualShock 4, DualSense and Switch Pro controllers over HID, gives each a free XInput slot and publishes its state in a shared memory section. The hook answers XInputGetState/Ex, GetCapabilities, GetBatteryInformation and SetState for that slot from it, only while the game is isolated, so games that only know Xbox controllers can use them without any driver. Vibration is sent back over USB. Hook protocol 6.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before: games that only know Xbox controllers did not react to a DualShock 4, DualSense or Switch Pro controller unless DS4Windows, x360ce or Steam Input with a driver was installed.
After: Controllers → "PlayStation and Switch controllers as an Xbox controller" (off by default). These controllers then appear to isolated games as an Xbox controller in a free slot, without any driver; the slot card says "Via InputSplit" and the controller test, shortcuts, dead zones and remapping work with it. Vibration works over USB.
How: the helper's new pad bridge opens the controllers over HID, parses their reports (DS4 USB/Bluetooth, DualSense USB/Bluetooth, Switch Pro 0x30/0x3F), gives each a free XInput slot and publishes its state in a shared memory section (
Local\InputSplit.PadBridge, seqlock). The hook answersXInputGetState/Ex,GetCapabilities,GetBatteryInformationandSetStatefor that slot from it, only while the game is isolated. Hook protocol 6. Known limits: a game that already reads these controllers natively may react twice (said in the setting's hint); Bluetooth vibration is not sent yet. Not yet tried on real Windows.